//api路由
//userApi.js —— 测试用 API 示例

var models = require('../db');
var express = require('express');
var router = express.Router();
var mysql = require('mysql');
// 连接数据库
var conn = mysql.createConnection(models.mysql);
conn.connect();

router.get('/query',(req,res)=>{
    conn.query('select * from input_craftinformation',function(err,row){
        if(err){
             console.log(err)            
        }
        let data = JSON.stringify(row)
        res.end(data)
    })
});


module.exports = router;

